<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<base href="<%=basePath%>"  />
<title>系统账户管理</title>
<jsp:include page="../common/common_css.jsp" />

<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="resource/metronic/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="resource/metronic/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css"/>
<link rel="stylesheet" type="text/css" href="resource/metronic/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css"/>
<link rel="stylesheet" type="text/css" href="resource/metronic/global/plugins/datatables/media/css/dataTables.bootstrap.css"/>
<!-- END PAGE LEVEL STYLES -->

<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed page-quick-sidebar-over-content ">
<!-- BEGIN HEADER -->
<jsp:include page="../common/head.jsp" />
<!-- END HEADER -->
<div class="clearfix">
</div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<jsp:include page="../common/menu.jsp" />
	<!-- END SIDEBAR -->
	
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- 主体内容 -->
			<h3 class="page-title">
				系统账号管理
				<small></small>
			</h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="index.html">主页</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="#">系统账号管理</a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box blue-hoki">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-globe"></i>
								所有账号管理
							</div>
							<div class="actions">
								<a href="javascript:;" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> 新增 </a>
								<a href="javascript:;" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> 删除 </a>
								<div class="btn-group">
									<a class="btn btn-default btn-sm" href="javascript:;" data-toggle="dropdown">
										<i class="fa fa-cogs"></i> Tools <i class="fa fa-angle-down"></i>
									</a>
									<ul class="dropdown-menu pull-right">
										<li>
											<a href="javascript:;">
											<i class="fa fa-pencil"></i> Edit </a>
										</li>
										<li>
											<a href="javascript:;">
											<i class="fa fa-trash-o"></i> Delete </a>
										</li>
										<li>
											<a href="javascript:;">
											<i class="fa fa-ban"></i> Ban </a>
										</li>
										<li class="divider">
										</li>
										<li>
											<a href="javascript:;">
											<i class="i"></i> Make admin </a>
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="portlet-body">
							<table class="table table-striped table-bordered table-hover" id="sample_0">
								<thead>
									<tr>
										<th class="table-checkbox" style="width:20px;"><input type="checkbox" class="checkall" /></th>
										<th style="width:40px;">序号</th>
										<th>用户名</th>
										<th>登录时间</th>
										<th>登录IP</th>
										<th>角色</th>
										<th>是否禁用</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							</table>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
			<!-- 主体内容 -->
		</div>
	</div>
	<!-- END CONTENT -->
	
	<!-- BEGIN QUICK SIDEBAR -->
	<jsp:include page="../common/sidebar.jsp" />
	<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<jsp:include page="../common/footer.jsp" />
<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<jsp:include page="../common/common_js.jsp" />
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script type="text/javascript" src="resource/metronic/global/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="resource/metronic/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="resource/metronic/global/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js"></script>
<script type="text/javascript" src="resource/metronic/global/plugins/datatables/media/js/dataTables.bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="resource/admin/js/datatables-pack.js"></script>
<script src="resource/admin/js/function-pack.js"></script>
<script>
jQuery(document).ready(function() {       
	Metronic.init(); // init metronic core components
	Layout.init(); // init current layout
	QuickSidebar.init(); // init quick sidebar
	BasePack.menuInit();//初始化菜单
	//BasePack.initTheme();//初始化样式模板
	
	var table = jQuery('#sample_0');
	var url = "manage/admin/ajaxShow";
	var reqData = {};
	var columns = [
	    {
	    	'data':null,
	    	'render':function(data,type,full){
	    		var content = '<div class="checker"><span>';
	    			content += '<input class="check" type="checkbox" value="'+full.id+'">';
	    			content += '</span></div>';
	    		return content;
	    	},
	    	'orderable':false
	    },
	    {'data':'id'},
	    {'data':'username'},
	    {
	    	'data':'logintime',
	    	'render':function(data,type,full){
	    		return FunctionPack.dateFormat(data,'yyyy-MM-dd');
	    	}
	    },
	    {'data':'loginip'},
	    {'data':'role.id'},
	    {
	    	'data':'isvalid',
	    	'render':function(data,type,full){
	    		return data == 0 ? '可用' : '禁用';
	    	}
	    },
	    {
	    	'data':null,
	    	'render':function(data,type,full){
	    		var content = '<a href="javascript:;" class="btn default btn-xs purple">';
	    			content += '<i class="fa fa-edit"></i> Edit </a>';
	    		return content;
	    	},
	    	'orderable':false
	    }
	];
	var order = [[3, "desc"]];
	DataTablePack.serverTable(table,url,reqData,columns,order);
	
});

</script>
</body>
<!-- END BODY -->
</html>